public abstract class GeneralDatabase{
    String type = "General";
    String host = "localhost";
    String port = "3306";
    String username = "root";
    String password = "admin";
    GeneralDatabase(String type,String host,String port,String username,String password) {
        this.type = type;
        this.host = host;
        this.port = port;
        this.username = username;
        this.password = password;
    }
    GeneralDatabase() {}
    public abstract void disconnect();//析构函数 释放所有资源
    public abstract String tryLogin(String username, String password) throws EmptyOutput,PermissionDenied;//登陆成功返回权限码，否则返回0
    public abstract String tryRigister(String username, String password) throws DuplicatedItem;
    public abstract String tryUserdel(String queryUsername, String deleteUsername) throws PermissionDenied,EmptyOutput;
    public abstract String tryUseradd(String queryUsername, String newUsername, String newPassword, int Permission) throws DuplicatedItem,PermissionDenied;
    public abstract String tryUsermod(String adminUsername, String targetUsername, int newPermission) throws PermissionDenied, EmptyOutput;

    public abstract String tryItemadd(String queryUsername, DiseaseItem item) throws PermissionDenied;
    public abstract String tryItemdel(String queryUsername, DiseaseItem item) throws PermissionDenied;
    //public abstract String tryItemmod(String queryUsername, DiseaseItem Source, DiseaseItem Destination) throws PermissionDenied;

    public abstract DiseaseItem[] querySymptoms(String symptom)throws EmptyOutput;
    public abstract DiseaseItem[] queryDiseases(String disease)throws EmptyOutput;
    public abstract DiseaseItem[] queryDepartments(String Department)throws EmptyOutput;
    public abstract String[] queryUsers(String Username)throws EmptyOutput;

    public abstract String[] getAllDepartments()throws EmptyOutput;
    public abstract String[] getAllUsers()throws EmptyOutput;
    public abstract String[][] getAllUserinfos();
    public abstract String checkUserinfo(String queryUser, String destUser) throws EmptyOutput;
}
